package com.aliyun.messagemgt.common.dto.send;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;

import javax.validation.constraints.NotNull;

/**
 * Created with IDEA
 *
 * @author:zhangxingxing 0027012120
 * @date:2019/1/22
 * @time:17:38
 */
@Data
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class MsgBody {
    /**
     * 类型
     */
    @NotNull(message = "消息类型 type 不能为空")
    private String type;
    /**
     * 单元名称
     */
    private String unitName;
    /**
     * 内容
     */
    @NotNull(message = "消息内容 content 不能为空")
    private String content;

    /****************************************************
     * 全科医生参数
     ****************************************************
     */
    private String accessUrl;

    private String alertLevel;

    private String alertType;

    private String sender;

    private String senderName;

    /**
     * 小程序渠道参数 业务分类
     */
    private String tag;

    /**
     * 图片地址
     */
    private String picUrl;

    /**
     * 消息地址
     */
    private String messageUrl;

    /**
     * 消息体的关键字
     */
    private String key;

    /**
     * 正整数，小于60，表示音频时长
     */
    private Long duration;

    /**
     * 按钮文字。 默认为“详情”， 不超过4个文字，超过自动截断
     */
    private String btntxt;

    /**
     * 作者
     */
    private String author;


    public MsgBody setType(String type) {
        this.type = type;
        return this;
    }

    public MsgBody setContent(String content) {
        this.content = content;
        return this;
    }

    public MsgBody setUnitName(String unitName) {
        this.unitName = unitName;
        return this;
    }

    public MsgBody setAccessUrl(String accessUrl) {
        this.accessUrl = accessUrl;
        return this;
    }

    public MsgBody setAlertLevel(String alertLevel) {
        this.alertLevel = alertLevel;
        return this;
    }

    public MsgBody setAlertType(String alertType) {
        this.alertType = alertType;
        return this;
    }

    public MsgBody setSender(String sender) {
        this.sender = sender;
        return this;
    }

    public MsgBody setSenderName(String senderName) {
        this.senderName = senderName;
        return this;
    }

    public MsgBody setTag(String tag) {
        this.tag = tag;
        return this;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
